package com.example.swing.jframe1;

import javax.swing.*;
import java.util.concurrent.TimeUnit;

public class JFrameTest1 {
    public static void main(String[] args) throws InterruptedException {
        JFrame frame = new JFrame("Hello Swing");
        JLabel lable = new JLabel("A Lable");
        JButton button = new JButton("A Button");
        button.setSize(100, 50);
        frame.add(lable);
        frame.add(button);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(500,300);
        frame.setVisible(true);
        TimeUnit.SECONDS.sleep(3);
        lable.setText("lable is change");
        button.setText("button is change");
    }

}
